/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.inventario.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "sttdei")
@IdClass(ST_SectorPK.class)
public class ST_Sector implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "STTDEI_DEPOSI", nullable = false, length = 15)
    private String deposi;
    @Id
    @Column(name = "STTDEI_SECTOR", nullable = false, length = 15)
    private String sector;

    @Basic(optional = false)
    @Column(name = "STTDEI_DESCRP", nullable = false, length = 60)
    private String descrp;

    @JoinColumn(name = "STTDEI_DEPOSI", referencedColumnName = "STTDEH_DEPOSI", nullable = false, insertable=false, updatable=false)
    @ManyToOne(optional = false)
    private ST_Deposito deposito;
    
    @Column(name = "STTDEI_DEBAJA")
    private String debaja;
    

    public ST_Sector() {
    }

    public ST_Sector(String deposi, String sector) {
        this.deposi = deposi;
        this.sector = sector;
    }

    public ST_Sector(String deposi, String sector, String descrp) {
        this.deposi = deposi;
        this.sector = sector;
        this.descrp = descrp;
    }
    
    public String getDeposi() {
        return deposi;
    }

    public void setDeposi(String deposi) {
        this.deposi = deposi;
    }

    public String getSector() {
        return sector;
    }

    public void setSector(String sector) {
        this.sector = sector;
    }

    public ST_Deposito getDeposito() {
        return deposito;
    }

    public void setDeposito(ST_Deposito deposito) {
        this.deposito = deposito;
    }

    public String getDebaja() {
        return debaja;
    }

    public void setDebaja(String debaja) {
        this.debaja = debaja;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ST_Sector other = (ST_Sector) obj;
        if ((this.deposi == null) ? (other.deposi != null) : !this.deposi.equals(other.deposi)) {
            return false;
        }
        if ((this.sector == null) ? (other.sector != null) : !this.sector.equals(other.sector)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + (this.deposi != null ? this.deposi.hashCode() : 0);
        hash = 89 * hash + (this.sector != null ? this.sector.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "ST_Sector{" + "deposi=" + deposi + "sector=" + sector + '}';
    }

    
    

}
